package com.moshang.blog.core.utils;

/**
 * @author xww
 * Created on 2019/4/25.
 */
public class RedisKeyUtils {

    //保存用户点赞数据的key
    public static final String MAP_KEY_USER_LIKED = "MAP_USER_LIKED";
    //保存用户被点赞数量的key
    public static final String MAP_KEY_USER_LIKED_COUNT = "MAP_USER_LIKED_COUNT";

    /**
     * 拼接点赞人id和文章id作为key。格式 222222::333333
     * @param likedUserId 点赞人id
     * @param articleId 文章id
     * @return
     */
    public static String getLikedKey(Integer likedUserId, Integer articleId){
        StringBuilder builder = new StringBuilder();
        builder.append(likedUserId);
        builder.append("::");
        builder.append(articleId);
        return builder.toString();
    }
}
